<template>
  <div>
    <div class="title">周末去哪儿</div>
    <ul>
      <li class="item border-bottom" v-for="item of list" :key="item.id">
        <div class="item-img-wrapper">
          <img class="item-img" :src="item.imgUrl" alt="景点图片" />
        </div>

        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <p class="item-desc">{{item.desc}}</p>
        </div>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  name: "HomeWeekend",
  props: {
    list: Array
  },
  data() {
    return {
      // recommendList: [
      //   {
      //     id: "0001",
      //     imgUrl:
      //       "https://imgs.qunarzz.com/vs_ceph_vs_tts/67d500ae-a5c7-42a8-9ca8-2be5da8ba921.jpg_r_480x320x90_4c6597bf.jpg",
      //     title: "大连圣亚海洋世界",
      //     desc: "浪漫大连首站，浪漫的海洋主题乐园"
      //   },
      //   {
      //     id: "0002",
      //     imgUrl:
      //       "https://imgs.qunarzz.com/p/p14/201302/28/218ac6605f1d637f93835fbb.jpg_256x160_bfee6c2d.jpg",
      //     title: "大连圣亚海洋世界",
      //     desc: "浪漫大连首站，浪漫的海洋主题乐园"
      //   },
      //   {
      //     id: "0003",
      //     imgUrl:
      //       "https://imgs.qunarzz.com/vs_ceph_vs_tts/5958b155-6345-4dc8-afea-881a83d90c60.jpg_r_480x320x90_c9422665.jpg",
      //     title: "大连圣亚海洋世界",
      //     desc: "浪漫大连首站，浪漫的海洋主题乐园"
      //   }
      // ]
    };
  }
};
</script>
<style lang="stylus" scoped>
@import '~styles/mixins.styl';

.title {
  margin-top: 0.2rem;
  line-height: 0.8rem;
  background: #eee;
  text-indent: 0.2rem;
}

.item-img-wrapper {
  overflow: hidden;
  height: 0;
  padding-bottom: 37.09%;

  .item-img {
    width: 100%;
  }
}

.item-info {
  padding: 0.1rem;
  // ... 可以正常显示出来
  min-width: 0;

  .item-title {
    line-height: 0.4rem;
    font-style: 0.32rem;
    ellipsis();
  }

  .item-desc {
    line-height: 0.4rem;
    color: #ccc;
    ellipsis();
  }
}
</style>